<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets" 
          
      xmlns:f="http://xmlns.jcp.org/jsf/core">
    <h:head>
    </h:head>
    <h:body>
        <ui:composition template="template/masterlayout.xhtml">
            <ui:define name="pagetitle">
                Reservations management
            </ui:define>
            <ui:define name="breadcrumb">
                <h:link value="Dashboard" outcome="index"/> &raquo; <h:link value="Reservations management" outcome="reservations"/>
            </ui:define>
            <ui:define name="content">
                <h:form>
                    <h:dataTable value="#{reservationBean.reservations}" var="reservation" columnClasses="patientName,reservationTime,require,action">
                    <h:column>
                        <f:facet name="header">Patient Name</f:facet>
                        #{reservation.patientName}
                    </h:column>
                    <h:column>
                        <f:facet name="header">Time</f:facet>
                        #{reservation.reservationTime}
                    </h:column>
                    <h:column>
                        <f:facet name="header">Require</f:facet>
                        #{reservation.require}
                    </h:column>                        
                    <h:column>
                        <f:facet name="header">Action</f:facet>
                        <h:link styleClass="view" value="View" outcome="reservation">
                            <f:param name="reservationID" value="#{reservation.reservationID}"/>
                        </h:link>
                        <h:link styleClass="edit" value="Edit" outcome="editreservation">
                            <f:param name="reservationID" value="#{reservation.reservationID}"/>
                        </h:link>
                        <h:commandLink styleClass="delete" value="Delete" action="#{reservationBean.deleteReservation(reservation.reservationID)}"></h:commandLink>                        
                    </h:column>
                </h:dataTable>
                </h:form>    
            </ui:define>
        </ui:composition>
    </h:body>
</html>

